<el-dialog :close-on-click-modal="false"  :close-on-press-escape="false"  class="dialogStyleBase" :title="mixinEdit_editTitle" width="800px" :visible.sync="mixinEdit_editVisible"
    :before-close="function(){mixinEdit_editBoxClose('editForm')}" append-to-body>
    <div class="dialogStyleBaseBox" v-loading="mixinEdit_loading">
    <el-form ref="editForm" :model="form" label-width="100px" label-position="left">
        <el-form-item label="规则名称"  prop="name"  :rules="{ required: true, message: '规则名称 不能为空'}">
            <el-input v-model="form.name" autosize maxlength="20"></el-input>
        </el-form-item>

        <el-form-item label="内容类型" prop="msgType">
            <el-radio-group class="radioStyleGhost s5" v-model="form.msgType">
                <el-radio-button :label="item.label" v-for="(item,index) in msgTypeList" :key="index">
                    <div><i :class="item.icon" style="margin-right:4px"></i>{{item.text}}</div>
                </el-radio-button>
            </el-radio-group>
        </el-form-item>



        <el-form-item label="文本内容" v-if="form.msgType=='text'">
            <el-input v-model="content.text" type="textarea" autosize maxlength="600" show-word-limit></el-input>
        </el-form-item>
        <el-form-item label="图片内容" v-if="form.msgType=='image'">
            <el-button @click="selectImage" style="margin-bottom:10px;">选择图片</el-button><br/>
            <img v-if="content.image" style="width:100px; height:100px;"
                :src="content.image.albumUrl"></img>
        </el-form-item>
        <el-form-item label="音频内容" v-if="form.msgType=='voice'">
            <el-button @click="selectVoice" style="margin-bottom:10px;">选择音频</el-button><br/>
            <audio v-if="content.voice" style="width:300px; height:50px;" controls="controls"
                :src="content.voice.albumUrl"></audio>
        </el-form-item>
        <el-form-item label="视频内容" v-if="form.msgType=='video'">
            <el-button @click="selectVideo" style="margin-bottom:10px;">选择视频</el-button><br/>
            <video v-if="content.video" style="width:300px; height:300px;" :src="content.video.albumUrl"
                controls="controls"></video>
        </el-form-item>
        <el-form-item label="图文内容" v-if="form.msgType=='news'">
            <el-button @click="selectTuwen" style="margin-bottom:10px;">选择图文</el-button><br/>
            <img v-if="content.news" style="width:100px; height:100px;"
            :src="content.news.coverUrl"></img>
        </el-form-item>

        <el-form-item label="是否开启" prop="isOpen">
            <el-switch v-model="form.isOpen" :active-value="1" :inactive-value="0">
            </el-switch>
        </el-form-item>


    </el-form>
</div>
    <div slot="footer">
        <el-row>
            <el-col :span="12" style="text-align: left;">
                <el-button :disabled="mixinEdit_loading" @click="mixinEdit_resetForm('editForm')">重 置</el-button>
            </el-col>
            <el-col :span="12">
                <el-button :disabled="mixinEdit_loading" @click="mixinEdit_editBoxClose('editForm')">取 消</el-button>
                <el-button :disabled="mixinEdit_loading" type="primary" @click="mixinEdit_editFormSubmit({model:'form',ref:'editForm'})">确
                    定</el-button>
            </el-col>
        </el-row>
    </div>

</el-dialog>
